package com.sc.nft.dao;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.sc.nft.entity.vo.merchantPledgeTask.MerchantPledgeTaskUserCollectionVO;
import lombok.extern.slf4j.Slf4j;
import com.sc.nft.entity.UserMerchantPledgeTaskCollectionRecords;
import com.sc.nft.mapper.UserMerchantPledgeTaskCollectionRecordsMapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 用户商户质押任务记录-藏品记录表(sc_user_merchant_pledge_task_collection_records)数据DAO
 *
 * @author Sun
 * @since 2023-11-06 13:36:41
 * @description 由 Mybatisplus Code Generator 创建
 */
@Slf4j
@Repository
public class UserMerchantPledgeTaskCollectionRecordsDao extends ServiceImpl<UserMerchantPledgeTaskCollectionRecordsMapper, UserMerchantPledgeTaskCollectionRecords> {

    public String getResultListByUserRecordsId(Long userRecordsId) {
        return baseMapper.getResultListByUserRecordsId(userRecordsId);
    }

    public List<MerchantPledgeTaskUserCollectionVO> getCollectionByUserRecordsIdGroupCollectionId(Long userRecordsId, Long userId) {
        return baseMapper.getCollectionByUserRecordsIdGroupCollectionId(userRecordsId,userId);
    }

    public List<UserMerchantPledgeTaskCollectionRecords> getListByUserRecordsId(Long userRecordsId) {
        LambdaQueryWrapper<UserMerchantPledgeTaskCollectionRecords> wrapper = new LambdaQueryWrapper<>();
        wrapper.eq(UserMerchantPledgeTaskCollectionRecords::getUserRecordsId, userRecordsId);
        return list(wrapper);
    }
}